import request from '@/helpers/request.js'

const URL = {
    REGISER: '/auth/register',
    LOGIN: '/auth/login',
    LOGOUT: '/auth/logout',
    GET_INFO: '/auth'
}

export default {
    register({username,password}) {
        return request(URL.REGISER,'POST',{ username,password})
    },
    login({username,password}) {
        return request(URL.LOGIN,'POST',{ username,password})
    },
    logout() {
        return request(URL.LOGOUT)
    },
    getInfo() {
        return request(URL.GET_INFO)
    }
}